#ifndef CCommand_HPP
#define CCommand_HPP

// System includes

// Other includes
#include "TypesCommands.hpp"

static const int   COMMAND_LENGTH = 5;  // bytes

class CCommand
{
public:
   /**
    * @brief Constructor
    * @param source    - Command source (Socket or Arduino)  
    * @param rawBuffer - Raw buffer that was just read from socket/serial
    *
    * rawBuffer is treated as Integer32 and as 4 Integer8 values. Both values are available
    * user should choose what values to use
    */
   CCommand(const eCommandSource source, const unsigned char* rawBuffer);

   CCommand(const eCommandSource source, const eCommand mType, const unsigned char mValue);

   void getRawBuffer(unsigned char* pBuffer);

   int getValue32() const;
   int getValue8_1() const;
   int getValue8_2() const;
   int getValue8_3() const;
   int getValue8_4() const;
   eCommand getType() const;
   eCommandSource getSource() const;

protected:

private:
   eCommand mCommandType;
   eCommandSource mCommandSource;
   int mValueInt32;
   int mValueInt8_1;
   int mValueInt8_2;
   int mValueInt8_3;
   int mValueInt8_4;
};

#endif // CCommand_HPP